package com.liuguang.testassert.security;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.util.LinkedHashMap;

/**
 * @ClassName: MyAuthenticationEntryPoint
 * @Description：
 * @Author: wanghr
 * Date: 3:04 PM 2020/6/1
 * Version: 1.0
 */
@Component
public class MyAuthenticationEntryPoint implements AuthenticationEntryPoint,Serializable {


    @Override
    public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
            httpServletResponse.sendError(403,"认证阶段出现问题啦！！！！");
    }
}
